from practices.p05_heap_01 import Heap
from utils.array_utils import sjlb, check_all


def heap_sort(li):
    h = Heap()
    for i in li:
        h.add(i)
    # print(h)
    for i in range(len(li)):
        m = h.pop_max()
        h.heap_insert(h.heap_size - 1)
        # print(m, h)
    return h.arr


if __name__ == '__main__':
    # arr = sjlb()
    # arr = [3, 4, 12, 4, 1]
    # print(arr)
    # print(heap_sort(arr))
    print(check_all(heap_sort, 1000))
